/**!
 * 
 */

Ext.define('App.Dashboard',{
	extend: 'Ext.ux.desktop.Module',
    
    id:'dash-win',
    
    init:function(){
    	// 此对象用于Start菜单
		this.launcher = {
			text: '自己定义的',
            iconCls:'accordion',
            handler : this.createWindow,
            scope: this
		}
    },
    
    createWindow: function(){
    	var desktop = this.app.getDesktop();
    	var win = desktop.getWindow('dash-win');
    	if (!win) {
    		win = desktop.createWindow({
    			id: 'dash-win',
                title:'系统运行面板',
                width:740,
                height:480,
                iconCls: 'icon-grid',
                animCollapse:false,
                border: false,
                //defaultFocus: 'notepad-editor', EXTJSIV-1300

                // IE has a bug where it will keep the iframe's background visible when the window
                // is set to visibility:hidden. Hiding the window via position offsets instead gets
                // around this bug.
                hideMode: 'offsets',

                layout: 'fit',
                items: [
                    {
                        xtype: 'htmleditor',
                        //xtype: 'textarea',
                        id: 'notepad-editor',
                        value: [
                            'Some <b>rich</b> <font color="red">text</font> goes <u>here</u><br>',
                            'Give it a try!'
                        ].join('')
                    }
                ]
    		});
    	}
    	win.show();
    	return win;
    }
});
